package com.incognito.spur.map;

import java.util.ArrayList;

import com.incognito.spur.map.renderer.TiledMapRenderer;
import com.incognito.spur.map.utility.Viewport;

public class TiledMap {

	private String name;
	private int height;
	private int width;
	
	private Layer collisionLayer;
	private ArrayList<Layer> normalLayers = new ArrayList<Layer>();
	private ArrayList<Layer> overlayLayers = new ArrayList<Layer>();
	
	private TiledMapRenderer renderer;
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getHeight() {
		return height;
	}

	public void setHeight(int height) {
		this.height = height;
	}

	public int getWidth() {
		return width;
	}

	public void setWidth(int width) {
		this.width = width;
	}

	public Layer getCollisionLayer() {
		return collisionLayer;
	}

	public void setCollisionLayer(Layer collisionLayer) {
		this.collisionLayer = collisionLayer;
	}

	public ArrayList<Layer> getNormalLayers() {
		return normalLayers;
	}

	public void setNormalLayers(ArrayList<Layer> normalLayers) {
		this.normalLayers = normalLayers;
	}

	public ArrayList<Layer> getOverlayLayers() {
		return overlayLayers;
	}

	public void setOverlayLayers(ArrayList<Layer> overlayLayers) {
		this.overlayLayers = overlayLayers;
	}

	public TiledMapRenderer getRenderer() {
		return renderer;
	}

	public void setRenderer(TiledMapRenderer renderer) {
		this.renderer = renderer;
	}
	
	public void addNormalLayer(Layer layer){
		normalLayers.add(layer);
	}
	
	public void addOverlayLayer(Layer layer){
		overlayLayers.add(layer);
	}
	
	public void drawNormalLayers(Object obj, Viewport viewport, int xOffset, int yOffset){
		renderer.drawLayers(obj, normalLayers, viewport, xOffset, yOffset);
	}
	
	public void drawOverlayLayers(Object obj, Viewport viewport, int xOffset, int yOffset){
		renderer.drawLayers(obj, overlayLayers, viewport, xOffset, yOffset);
	}
}
